/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO

Authors: Nitay Megides
		 Rachel Banino

Project: Exercise 1

Using: LinkedList.h
	   General.h
	   Hw1Types.h

Description:
A List, based on LinkedList, that contains and manages the different 
users in the system. Each list node has a pointer to TUser, which contains the 
inforamtion about the relevant user
oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/

#ifndef USER_LIST_H
#define USER_LIST_H

#include "General.h"
#include "LinkedList.h"
#include "Hw1Types.h"

/*
 * TUser - Represents a user
 */
typedef struct 
{
    int ID;
	char Name[MAX_NAME_LEN];
	char Nickname[MAX_NAME_LEN];
} TUser;
typedef TUser* PUser;


/**
 * Initializes the user list. MUST BE CALLED PRIOR TO USING THIS MODULE
 * Returns TRUE on succress, FALSE on failure
 */ 
BOOL InitializeUserList();

/**
 * Adds a new user to the list with product id = ID, name = Name, and nickname = Nickname
 * Returns TRUE on succress, FALSE on failure
 */ 
BOOL AddUser(const TUserID ID, const char* Name, const char* Nickname);

/**
 * Returns a user with an id as ID. If no user is found, returns NULL
 */ 
PUser GetUser(const TUserID ID);

/**
 * Frees the resources taken by this module
 */ 
void FreeUserList();

#endif // USER_LIST_H

